/**
 * Datart
 *
 * Copyright 2021
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

function DatartVxeTableChart({ dHelper }) {
  return {
    config: {
      datas: [
        {
          label: 'metrics',
          key: 'metrics',
          required: true,
          type: 'group',
        },
        {
          label: 'dimension',
          key: 'dimension',
          required: true,
          // type: 'aggregate',
          // limit: [0, 88],
          type: 'aggregate',
          // actions: ['sortable', 'alias'],
          actions: {
            STRING: ['alias', 'sortable', 'aggregate', 'filter', 'format'],
            NUMERIC: ['alias', 'sortable', 'aggregate', 'filter', 'format'],
          },
        },
        {
          label: 'filter',
          key: 'filter',
          type: 'filter',
          allowSameField: true,
        },
      ],
      styles: [],
      i18ns: [
        {
          lang: 'zh-CN',
          translation: {
            data: {
              color: '颜色',
              colorize: '配色',
            },
          },
        },
        {
          lang: 'en-US',
          translation: {
            data: {
              color: 'Color',
              colorize: 'Colorize',
            },
          },
        },
      ],
    },
    isISOContainer: 'datart-vxe-table',
    dependency: [
      'https://cdn.jsdelivr.net/npm/vue@2.5.16/dist/vue.js',
      'https://cdn.jsdelivr.net/npm/vxe-table@3.5.2/lib/style.css',
      'https://cdn.jsdelivr.net/npm/xe-utils',
      'https://cdn.jsdelivr.net/npm/vxe-table@3',
    ],
    meta: {
      id: 'datart-vxe-table',
      name: 'vxe-table-复杂表格',
      icon: 'chart',
      requirements: [
        {
          group: null,
          aggregate: null,
        },
      ],
    },
    nodeId: 'app',

    onMount(options, context) {
      const node = context.document.createElement('div');
      node.setAttribute('id', this.nodeId);
      context.document.getElementById(options.containerId).appendChild(node);
      const Vue = context.window.Vue;
      const VXETable = context.window.VXETable;
      Vue.use(VXETable);
      const total = {
        contractSignYear: '3361',
        putonSkuNumYear: '1616187',
        contractSignDay: '88',
        zdFsAdoptYear: '3220',
        itemPriceDay: '2467.39',
        putonSkuNumTotal: '161187',
        zdFsAdoptNow: '25209',
        contractSkuNumYear: '32556',
        wzgsContractSignNow: '2167',
        submitNumDay: '70',
        itemNumDay: '208652',
        contractSkuNumDay: '2746',
        submitNumMonth: '885',
        wzgsContractSignTotal: '23727',
        itemPriceTotal: '60091.82',
        contractSkuNumNow: 0,
        skuNumMonth: '18117',
        itemNumMonth: '162250',
        itemPriceYear: '1519.24',
        zdFsAdoptDay: '81',
        zdCsAdoptMonth: '76',
        submitNumTotal: '3033',
        contractSignMonth: '88',
        zdCsAdoptNow: '2534',
        putonSkuNumNow: 0,
        itemNumYear: '773145',
        skuNumNow: '19503',
        putonSkuNumDay: '24488',
        contractSkuNumTotal: '3427352',
        itemPriceMonth: '2685.84',
        submitNumYear: '398',
        skuNumTotal: '220024',
        wzgsContractSignDay: '102',
        contractSignNow: '2342',
        itemPriceNow: 0,
        zdCsAdoptTotal: '2534',
        itemNumTotal: '2268571',
        submitNumNow: '3003',
        zdFsAdoptTotal: '2509',
        contractSignTotal: '2842',
        abbreviationName: '合计',
        itemNumNow: 0,
        skuNumDay: '24633',
        putonSkuNumMonth: '1239',
        contractSkuNumMonth: '30520',
        zdCsAdoptYear: '379',
        zdFsAdoptMonth: '817',
        wzgsContractSignYear: '343',
        zdCsAdoptDay: '90',
        wzgsContractSignMonth: '83',
        skuNumYear: '6507',
      };
      this.chart = new Vue({
        el: `#${this.nodeId}`,
        data() {
          return {
            sty: {
              darkBlue: {
                backgroundColor: '#0091da',
                color: '#ffffff',
                fontSize: '14px',
              },
              blue: {
                backgroundColor: '#70bde8',
                color: '#ffffff',
                fontSize: '14px',
              },
            },
            cellSty: {
              fontSize: '14px',
              fontWeight: 'normal',
              color: '#606266',
              padding: '5px 0',
            },
            gridOptions: {
              ref: 'xGrid',
              border: true,
              stripe: true,
              // resizable: true,
              maxHeight: '100%',
              align: 'center',
              autoResize: true,
              // size: 'mini',
              rowConfig: { isHover: true },
              headerCellStyle: this.headerCellStyle,
              footerCellStyle: this.footerCellStyle,
              showFooter: true,
              footerMethod: this.footerMethod,
              mergeFooterItems: [{ row: 0, col: 0, rowspan: 1, colspan: 2 }],
              cellStyle: this.cellStyle,
              // printConfig: {},
              // toolbarConfig: this.tableToolbar,
              // toolbarToolClick: this.toolbarToolClick,
              // 分组列头，通过 children 定义子列
              columns: [
                {
                  title: '部门',
                  fixed: 'left',
                  children: [
                    { type: 'seq', title: '序号', minWidth: '60px' },
                    {
                      field: 'abbreviationName',
                      title: '部门名称',
                      minWidth: '100px',
                    },
                  ],
                },
                {
                  title: '货物种类',
                  children: [
                    {
                      title: '种类数量',
                      children: [
                        {
                          field: 'skuNumMonth',
                          title: '新增数量',
                          minWidth: '100px',
                        },
                        {
                          field: 'skuNumTotal',
                          title: '总数量',
                          minWidth: '100px',
                        },
                      ],
                    },
                  ],
                },
                {
                  title: '销售额',
                  children: [
                    {
                      title: '货物销售数量',
                      children: [
                        {
                          field: 'itemNumDay',
                          title: '当天',
                          minWidth: '100px',
                        },
                        {
                          field: 'itemNumMonth',
                          title: '本月',
                          minWidth: '100px',
                        },
                      ],
                    },
                    {
                      title: '货物销售金额',
                      children: [
                        {
                          field: 'itemPriceDay',
                          title: '当天',
                          minWidth: '100px',
                        },
                        {
                          field: 'itemPriceMonth',
                          title: '本月',
                          minWidth: '100px',
                        },
                        {
                          field: 'itemPriceYear',
                          title: '年累计',
                          minWidth: '100px',
                        },
                        {
                          field: 'itemPriceTotal',
                          title: '总累计',
                          minWidth: '100px',
                        },
                      ],
                    },
                  ],
                },
              ],
              data: [
                {
                  contractSignYear: '174',
                  putonSkuNumYear: '66395',
                  contractSignDay: '0',
                  zdFsAdoptYear: '158',
                  itemPriceDay: '193.32',
                  putonSkuNumTotal: '66395',
                  zdFsAdoptNow: '1073',
                  contractSkuNumYear: '22751',
                  tips: '',
                  wzgsContractSignNow: '981',
                  submitNumDay: '4',
                  itemNumDay: '1266',
                  contractSkuNumDay: '1907',
                  submitNumMonth: '39',
                  wzgsContractSignTotal: '1034',
                  itemPriceTotal: '40545.58',
                  contractSkuNumNow: '0',
                  skuNumMonth: '7635',
                  itemNumMonth: '141407',
                  itemPriceYear: '851.77',
                  zdFsAdoptDay: '5',
                  zdCsAdoptMonth: '39',
                  submitNumTotal: '1225',
                  contractSignMonth: '37',
                  zdCsAdoptNow: '1078',
                  putonSkuNumNow: '0',
                  itemNumYear: '86611',
                  skuNumNow: '7872',
                  putonSkuNumDay: '118',
                  contractSkuNumTotal: '16169',
                  itemPriceMonth: '198.92',
                  submitNumYear: '162',
                  skuNumTotal: '8627',
                  wzgsContractSignDay: '5',
                  contractSignNow: '1034',
                  itemPriceNow: '0.00',
                  zdCsAdoptTotal: '1078',
                  itemNumTotal: '38495677',
                  submitNumNow: '1225',
                  zdFsAdoptTotal: '1073',
                  contractSignTotal: '1034',
                  abbreviationName: '部门1',
                  itemNumNow: '0',
                  skuNumDay: '829',
                  putonSkuNumMonth: '6770',
                  contractSkuNumMonth: '11109',
                  zdCsAdoptYear: '157',
                  zdFsAdoptMonth: '36',
                  wzgsContractSignYear: '176',
                  time: '2022-03-14',
                  zdCsAdoptDay: '3',
                  wzgsContractSignMonth: '39',
                  skuNumYear: '27807',
                },
                {
                  contractSignYear: '216',
                  putonSkuNumYear: '141272',
                  contractSignDay: '4',
                  zdFsAdoptYear: '202',
                  itemPriceDay: '250.58',
                  putonSkuNumTotal: '141272',
                  zdFsAdoptNow: '1561',
                  contractSkuNumYear: '58034',
                  wzgsContractSignNow: '1378',
                  tips: '',
                  submitNumDay: '5',
                  itemNumDay: '102182',
                  contractSkuNumDay: '1949',
                  submitNumMonth: '66',
                  wzgsContractSignTotal: '1489',
                  itemPriceTotal: '64242.27',
                  contractSkuNumNow: '0',
                  skuNumMonth: '19468',
                  itemNumMonth: '1152806',
                  itemPriceYear: '17537.16',
                  zdFsAdoptDay: '1',
                  zdCsAdoptMonth: '48',
                  submitNumTotal: '1878',
                  zdCsAdoptNow: '1564',
                  putonSkuNumNow: '0',
                  contractSignMonth: '40',
                  itemNumYear: '4748385',
                  skuNumNow: '167904',
                  putonSkuNumDay: '2221',
                  itemPriceMonth: '2658.30',
                  contractSkuNumTotal: '338226',
                  submitNumYear: '223',
                  skuNumTotal: '186264',
                  wzgsContractSignDay: '5',
                  contractSignNow: '1492',
                  itemPriceNow: '0.00',
                  zdCsAdoptTotal: '1564',
                  itemNumTotal: '14937488',
                  submitNumNow: '1878',
                  zdFsAdoptTotal: '1561',
                  contractSignTotal: '1492',
                  abbreviationName: '部门2',
                  itemNumNow: '0',
                  skuNumDay: '1439',
                  putonSkuNumMonth: '13182',
                  contractSkuNumMonth: '24974',
                  zdCsAdoptYear: '200',
                  zdFsAdoptMonth: '51',
                  wzgsContractSignYear: '233',
                  time: '2022-03-14',
                  zdCsAdoptDay: '2',
                  wzgsContractSignMonth: '49',
                  skuNumYear: '56465',
                },
                {
                  contractSignYear: '435',
                  putonSkuNumYear: '22871',
                  contractSignDay: '12',
                  zdFsAdoptYear: '427',
                  itemPriceDay: '256.64',
                  putonSkuNumTotal: '22871',
                  zdFsAdoptNow: '3595',
                  contractSkuNumYear: '3392',
                  tips: '',
                  wzgsContractSignNow: '347',
                  submitNumDay: '11',
                  itemNumDay: '9087',
                  contractSkuNumDay: '480',
                  submitNumMonth: '121',
                  wzgsContractSignTotal: '391',
                  itemPriceTotal: '5359.75',
                  contractSkuNumNow: '0',
                  skuNumMonth: '25638',
                  itemNumMonth: '2233002',
                  itemPriceYear: '11503.29',
                  zdFsAdoptDay: '7',
                  zdCsAdoptMonth: '96',
                  submitNumTotal: '4151',
                  contractSignMonth: '98',
                  zdCsAdoptNow: '3601',
                  putonSkuNumNow: '0',
                  itemNumYear: '9842052',
                  skuNumNow: '259675',
                  putonSkuNumDay: '5084',
                  itemPriceMonth: '2819.55',
                  contractSkuNumTotal: '526436',
                  submitNumYear: '491',
                  skuNumTotal: '290910',
                  wzgsContractSignDay: '20',
                  contractSignNow: '3519',
                  itemPriceNow: '0.00',
                  zdCsAdoptTotal: '301',
                  itemNumTotal: '246172',
                  submitNumNow: '4151',
                  zdFsAdoptTotal: '3595',
                  contractSignTotal: '3519',
                  abbreviationName: '部门3',
                  itemNumNow: '0',
                  skuNumDay: '4533',
                  putonSkuNumMonth: '27082',
                  contractSkuNumMonth: '39669',
                  zdCsAdoptYear: '421',
                  zdFsAdoptMonth: '100',
                  wzgsContractSignYear: '490',
                  time: '2022-03-14',
                  zdCsAdoptDay: '9',
                  wzgsContractSignMonth: '100',
                  skuNumYear: '80457',
                },
                {
                  contractSignYear: '255',
                  putonSkuNumYear: '7841',
                  contractSignDay: '10',
                  zdFsAdoptYear: '29',
                  itemPriceDay: '128.71',
                  putonSkuNumTotal: '17841',
                  zdFsAdoptNow: '1579',
                  contractSkuNumYear: '31470',
                  tips: '',
                  wzgsContractSignNow: '1422',
                  submitNumDay: '5',
                  itemNumDay: '115144',
                  contractSkuNumDay: '2446',
                  submitNumMonth: '60',
                  wzgsContractSignTotal: '1516',
                  itemPriceTotal: '25681.66',
                  contractSkuNumNow: '0',
                  skuNumMonth: '14449',
                  itemNumMonth: '77015',
                  itemPriceYear: '715.83',
                  zdFsAdoptDay: '9',
                  zdCsAdoptMonth: '53',
                  submitNumTotal: '129',
                  contractSignMonth: '57',
                  zdCsAdoptNow: '151',
                  putonSkuNumNow: '0',
                  itemNumYear: '41277',
                  skuNumNow: '14601',
                  putonSkuNumDay: '2200',
                  contractSkuNumTotal: '234440',
                  itemPriceMonth: '1572.40',
                  submitNumYear: '246',
                  skuNumTotal: '168662',
                  wzgsContractSignDay: '10',
                  contractSignNow: '1520',
                  itemPriceNow: '0.00',
                  zdCsAdoptTotal: '1581',
                  itemNumTotal: '8200327',
                  submitNumNow: '1729',
                  zdFsAdoptTotal: '1579',
                  contractSignTotal: '1520',
                  abbreviationName: '部门4',
                  itemNumNow: '0',
                  skuNumDay: '2301',
                  putonSkuNumMonth: '6125',
                  contractSkuNumMonth: '24398',
                  zdCsAdoptYear: '236',
                  zdFsAdoptMonth: '52',
                  wzgsContractSignYear: '254',
                  time: '2022-03-14',
                  zdCsAdoptDay: '7',
                  wzgsContractSignMonth: '59',
                  skuNumYear: '52695',
                },
                {
                  contractSignYear: '73',
                  putonSkuNumYear: '91602',
                  contractSignDay: '1',
                  zdFsAdoptYear: '74',
                  itemPriceDay: '156.30',
                  putonSkuNumTotal: '91602',
                  zdFsAdoptNow: '1051',
                  contractSkuNumYear: '9172',
                  tips: '',
                  wzgsContractSignNow: '850',
                  submitNumDay: '1',
                  itemNumDay: '39292',
                  contractSkuNumDay: '1862',
                  submitNumMonth: '15',
                  wzgsContractSignTotal: '989',
                  itemPriceTotal: '24476.97',
                  contractSkuNumNow: '0',
                  skuNumMonth: '8156',
                  itemNumMonth: '572247',
                  itemPriceYear: '5329.05',
                  zdFsAdoptDay: '4',
                  zdCsAdoptMonth: '14',
                  submitNumTotal: '1250',
                  contractSignMonth: '13',
                  zdCsAdoptNow: '1053',
                  putonSkuNumNow: '0',
                  itemNumYear: '1968120',
                  skuNumNow: '114411',
                  putonSkuNumDay: '721',
                  itemPriceMonth: '1254.69',
                  contractSkuNumTotal: '171791',
                  submitNumYear: '86',
                  skuNumTotal: '126950',
                  wzgsContractSignDay: '1',
                  contractSignNow: '993',
                  itemPriceNow: '0.00',
                  zdCsAdoptTotal: '1053',
                  itemNumTotal: '7284951',
                  submitNumNow: '1250',
                  zdFsAdoptTotal: '1051',
                  contractSignTotal: '993',
                  abbreviationName: '部门5',
                  itemNumNow: '0',
                  skuNumDay: '738',
                  putonSkuNumMonth: '13782',
                  contractSkuNumMonth: '9621',
                  zdCsAdoptYear: '77',
                  zdFsAdoptMonth: '12',
                  wzgsContractSignYear: '72',
                  time: '2022-03-14',
                  zdCsAdoptDay: '3',
                  wzgsContractSignMonth: '13',
                  skuNumYear: '41342',
                },
                {
                  contractSignYear: '190',
                  putonSkuNumYear: '132031',
                  contractSignDay: '6',
                  zdFsAdoptYear: '177',
                  itemPriceDay: '171.38',
                  putonSkuNumTotal: '132031',
                  zdFsAdoptNow: '1433',
                  contractSkuNumYear: '33172',
                  wzgsContractSignNow: '1172',
                  tips: '',
                  submitNumDay: '7',
                  itemNumDay: '36179',
                  contractSkuNumDay: '434',
                  submitNumMonth: '54',
                  wzgsContractSignTotal: '1309',
                  itemPriceTotal: '59246.17',
                  contractSkuNumNow: '0',
                  skuNumMonth: '11245',
                  itemNumMonth: '941364',
                  itemPriceYear: '14510.61',
                  zdFsAdoptDay: '1',
                  zdCsAdoptMonth: '41',
                  submitNumTotal: '1628',
                  zdCsAdoptNow: '1433',
                  putonSkuNumNow: '0',
                  contractSignMonth: '55',
                  itemNumYear: '4300461',
                  skuNumNow: '170134',
                  putonSkuNumDay: '1287',
                  contractSkuNumTotal: '278965',
                  itemPriceMonth: '2848.74',
                  submitNumYear: '210',
                  skuNumTotal: '197466',
                  wzgsContractSignDay: '6',
                  contractSignNow: '1312',
                  itemPriceNow: '0.00',
                  zdCsAdoptTotal: '1433',
                  itemNumTotal: '15347513',
                  submitNumNow: '1628',
                  zdFsAdoptTotal: '1433',
                  contractSignTotal: '1312',
                  abbreviationName: '部门6',
                  itemNumNow: '0',
                  skuNumDay: '1037',
                  putonSkuNumMonth: '10257',
                  contractSkuNumMonth: '31493',
                  zdCsAdoptYear: '172',
                  zdFsAdoptMonth: '46',
                  wzgsContractSignYear: '189',
                  time: '2022-03-14',
                  zdCsAdoptDay: '1',
                  wzgsContractSignMonth: '60',
                  skuNumYear: '48387',
                },
                {
                  contractSignYear: '155',
                  putonSkuNumYear: '78539',
                  contractSignDay: '3',
                  zdFsAdoptYear: '154',
                  itemPriceDay: '208.80',
                  putonSkuNumTotal: '78539',
                  zdFsAdoptNow: '1154',
                  contractSkuNumYear: '9364',
                  tips: '',
                  wzgsContractSignNow: '991',
                  submitNumDay: '3',
                  itemNumDay: '50966',
                  contractSkuNumDay: '971',
                  submitNumMonth: '49',
                  wzgsContractSignTotal: '1066',
                  itemPriceTotal: '29495.87',
                  contractSkuNumNow: '0',
                  skuNumMonth: '8298',
                  itemNumMonth: '374227',
                  itemPriceYear: '11369.21',
                  zdFsAdoptDay: '3',
                  zdCsAdoptMonth: '39',
                  submitNumTotal: '1378',
                  zdCsAdoptNow: '1163',
                  putonSkuNumNow: '0',
                  contractSignMonth: '50',
                  itemNumYear: '2055709',
                  skuNumNow: '91579',
                  putonSkuNumDay: '567',
                  contractSkuNumTotal: '141755',
                  itemPriceMonth: '1609.16',
                  submitNumYear: '173',
                  skuNumTotal: '97064',
                  wzgsContractSignDay: '4',
                  contractSignNow: '1073',
                  itemPriceNow: '0.00',
                  zdCsAdoptTotal: '1163',
                  itemNumTotal: '5258700',
                  submitNumNow: '1378',
                  zdFsAdoptTotal: '1154',
                  contractSignTotal: '1073',
                  abbreviationName: '部门7',
                  itemNumNow: '0',
                  skuNumDay: '655',
                  putonSkuNumMonth: '7590',
                  contractSkuNumMonth: '10616',
                  zdCsAdoptYear: '151',
                  zdFsAdoptMonth: '46',
                  wzgsContractSignYear: '157',
                  time: '2022-03-14',
                  zdCsAdoptDay: '1',
                  wzgsContractSignMonth: '51',
                  skuNumYear: '32354',
                },
                {
                  contractSignYear: '123',
                  putonSkuNumYear: '66080',
                  contractSignDay: '5',
                  zdFsAdoptYear: '111',
                  itemPriceDay: '79.80',
                  putonSkuNumTotal: '66080',
                  zdFsAdoptNow: '1171',
                  contractSkuNumYear: '27091',
                  tips: '',
                  wzgsContractSignNow: '984',
                  submitNumDay: '2',
                  itemNumDay: '120525',
                  contractSkuNumDay: '538',
                  submitNumMonth: '29',
                  wzgsContractSignTotal: '1087',
                  itemPriceTotal: '37176.05',
                  contractSkuNumNow: '0',
                  skuNumMonth: '9624',
                  itemNumMonth: '10791',
                  itemPriceYear: '6410.98',
                  zdFsAdoptDay: '2',
                  zdCsAdoptMonth: '23',
                  submitNumTotal: '100',
                  zdCsAdoptNow: '1174',
                  putonSkuNumNow: '0',
                  contractSignMonth: '20',
                  itemNumYear: '216428',
                  skuNumNow: '7822',
                  putonSkuNumDay: '1312',
                  itemPriceMonth: '178.97',
                  contractSkuNumTotal: '14942',
                  submitNumYear: '119',
                  skuNumTotal: '9131',
                  wzgsContractSignDay: '3',
                  contractSignNow: '1090',
                  itemPriceNow: '0.00',
                  zdCsAdoptTotal: '1174',
                  itemNumTotal: '5982931',
                  submitNumNow: '1300',
                  zdFsAdoptTotal: '1171',
                  contractSignTotal: '1090',
                  abbreviationName: '部门8',
                  itemNumNow: '0',
                  skuNumDay: '1323',
                  putonSkuNumMonth: '3933',
                  contractSkuNumMonth: '20051',
                  zdCsAdoptYear: '110',
                  zdFsAdoptMonth: '23',
                  wzgsContractSignYear: '125',
                  time: '2022-03-14',
                  zdCsAdoptDay: '2',
                  wzgsContractSignMonth: '20',
                  skuNumYear: '27792',
                },
                {
                  contractSignYear: '417',
                  putonSkuNumYear: '120919',
                  contractSignDay: '9',
                  zdFsAdoptYear: '391',
                  itemPriceDay: '216.77',
                  putonSkuNumTotal: '120919',
                  zdFsAdoptNow: '3010',
                  contractSkuNumYear: '22224',
                  tips: '',
                  wzgsContractSignNow: '2495',
                  submitNumDay: '10',
                  itemNumDay: '50887',
                  contractSkuNumDay: '2693',
                  submitNumMonth: '95',
                  wzgsContractSignTotal: '2807',
                  itemPriceTotal: '43340.58',
                  contractSkuNumNow: '0',
                  skuNumMonth: '11958',
                  itemNumMonth: '2439975',
                  itemPriceYear: '11200.29',
                  zdFsAdoptDay: '10',
                  zdCsAdoptMonth: '91',
                  submitNumTotal: '3966',
                  zdCsAdoptNow: '3026',
                  putonSkuNumNow: '0',
                  contractSignMonth: '97',
                  itemNumYear: '14315867',
                  skuNumNow: '145183',
                  putonSkuNumDay: '1364',
                  contractSkuNumTotal: '251765',
                  itemPriceMonth: '1852.02',
                  submitNumYear: '425',
                  skuNumTotal: '162310',
                  wzgsContractSignDay: '13',
                  contractSignNow: '2812',
                  itemPriceNow: '0.00',
                  zdCsAdoptTotal: '3026',
                  itemNumTotal: '22597131',
                  submitNumNow: '3966',
                  zdFsAdoptTotal: '3010',
                  contractSignTotal: '2812',
                  abbreviationName: '部门9',
                  itemNumNow: '0',
                  skuNumDay: '1290',
                  putonSkuNumMonth: '6387',
                  contractSkuNumMonth: '22592',
                  zdCsAdoptYear: '373',
                  zdFsAdoptMonth: '111',
                  wzgsContractSignYear: '432',
                  time: '2022-03-14',
                  zdCsAdoptDay: '8',
                  wzgsContractSignMonth: '96',
                  skuNumYear: '56819',
                },
                {
                  contractSignYear: '287',
                  putonSkuNumYear: '18065',
                  contractSignDay: '7',
                  zdFsAdoptYear: '292',
                  itemPriceDay: '219.93',
                  putonSkuNumTotal: '18095',
                  zdFsAdoptNow: '1929',
                  contractSkuNumYear: '5391',
                  tips: '',
                  wzgsContractSignNow: '195',
                  submitNumDay: '3',
                  itemNumDay: '12561',
                  contractSkuNumDay: '579',
                  submitNumMonth: '84',
                  wzgsContractSignTotal: '178',
                  itemPriceTotal: '4473.38',
                  contractSkuNumNow: '0',
                  skuNumMonth: '19915',
                  itemNumMonth: '714612',
                  itemPriceYear: '13830.90',
                  zdFsAdoptDay: '6',
                  zdCsAdoptMonth: '79',
                  submitNumTotal: '2375',
                  zdCsAdoptNow: '1952',
                  putonSkuNumNow: '0',
                  contractSignMonth: '73',
                  itemNumYear: '4723459',
                  skuNumNow: '224284',
                  putonSkuNumDay: '2978',
                  contractSkuNumTotal: '365065',
                  itemPriceMonth: '2439.86',
                  submitNumYear: '312',
                  skuNumTotal: '258260',
                  wzgsContractSignDay: '9',
                  contractSignNow: '1774',
                  itemPriceNow: '0.00',
                  zdCsAdoptTotal: '1952',
                  itemNumTotal: '16489572',
                  submitNumNow: '2375',
                  zdFsAdoptTotal: '1929',
                  contractSignTotal: '1774',
                  abbreviationName: '部门10',
                  itemNumNow: '0',
                  skuNumDay: '3453',
                  putonSkuNumMonth: '3155',
                  contractSkuNumMonth: '38368',
                  zdCsAdoptYear: '275',
                  zdFsAdoptMonth: '71',
                  wzgsContractSignYear: '287',
                  time: '2022-03-14',
                  zdCsAdoptDay: '11',
                  wzgsContractSignMonth: '73',
                  skuNumYear: '64737',
                },
                {
                  contractSignYear: '136',
                  putonSkuNumYear: '79877',
                  contractSignDay: '2',
                  zdFsAdoptYear: '115',
                  itemPriceDay: '97.62',
                  putonSkuNumTotal: '79877',
                  zdFsAdoptNow: '1229',
                  contractSkuNumYear: '5131',
                  tips: '',
                  wzgsContractSignNow: '1122',
                  submitNumDay: '5',
                  itemNumDay: '68799',
                  contractSkuNumDay: '562',
                  submitNumMonth: '29',
                  wzgsContractSignTotal: '1169',
                  itemPriceTotal: '15680.00',
                  contractSkuNumNow: '0',
                  skuNumMonth: '5543',
                  itemNumMonth: '858933',
                  itemPriceYear: '3855.03',
                  zdFsAdoptDay: '6',
                  zdCsAdoptMonth: '24',
                  submitNumTotal: '1404',
                  contractSignMonth: '36',
                  zdCsAdoptNow: '1241',
                  putonSkuNumNow: '0',
                  itemNumYear: '3358379',
                  skuNumNow: '96025',
                  putonSkuNumDay: '969',
                  itemPriceMonth: '974.10',
                  contractSkuNumTotal: '108153',
                  submitNumYear: '119',
                  skuNumTotal: '104005',
                  wzgsContractSignDay: '3',
                  contractSignNow: '1171',
                  itemPriceNow: '0.00',
                  zdCsAdoptTotal: '1241',
                  itemNumTotal: '6046620',
                  submitNumNow: '1404',
                  zdFsAdoptTotal: '1229',
                  contractSignTotal: '1171',
                  abbreviationName: '部门11',
                  itemNumNow: '0',
                  skuNumDay: '1375',
                  putonSkuNumMonth: '3398',
                  contractSkuNumMonth: '4475',
                  zdCsAdoptYear: '116',
                  zdFsAdoptMonth: '35',
                  wzgsContractSignYear: '136',
                  time: '2022-03-14',
                  zdCsAdoptDay: '6',
                  wzgsContractSignMonth: '34',
                  skuNumYear: '24850',
                },
                {
                  contractSignYear: '318',
                  putonSkuNumYear: '85768',
                  contractSignDay: '10',
                  zdFsAdoptYear: '311',
                  itemPriceDay: '106.31',
                  putonSkuNumTotal: '85768',
                  zdFsAdoptNow: '1610',
                  contractSkuNumYear: '14523',
                  tips: '',
                  wzgsContractSignNow: '1455',
                  submitNumDay: '3',
                  itemNumDay: '41431',
                  contractSkuNumDay: '867',
                  submitNumMonth: '79',
                  wzgsContractSignTotal: '1539',
                  itemPriceTotal: '44176.12',
                  contractSkuNumNow: '0',
                  skuNumMonth: '9778',
                  itemNumMonth: '800143',
                  itemPriceYear: '11115.17',
                  zdFsAdoptDay: '6',
                  zdCsAdoptMonth: '88',
                  submitNumTotal: '2028',
                  zdCsAdoptNow: '1617',
                  putonSkuNumNow: '0',
                  contractSignMonth: '80',
                  itemNumYear: '2115050',
                  skuNumNow: '96542',
                  putonSkuNumDay: '153',
                  contractSkuNumTotal: '167433',
                  itemPriceMonth: '1643.01',
                  submitNumYear: '315',
                  skuNumTotal: '105730',
                  wzgsContractSignDay: '6',
                  contractSignNow: '1545',
                  itemPriceNow: '0.00',
                  zdCsAdoptTotal: '1617',
                  itemNumTotal: '7795115',
                  submitNumNow: '2028',
                  zdFsAdoptTotal: '1610',
                  contractSignTotal: '1545',
                  abbreviationName: '部门12',
                  itemNumNow: '0',
                  skuNumDay: '1170',
                  putonSkuNumMonth: '9794',
                  contractSkuNumMonth: '13270',
                  zdCsAdoptYear: '320',
                  zdFsAdoptMonth: '85',
                  wzgsContractSignYear: '316',
                  time: '2022-03-14',
                  zdCsAdoptDay: '12',
                  wzgsContractSignMonth: '76',
                  skuNumYear: '30666',
                },
                {
                  contractSignYear: '137',
                  putonSkuNumYear: '46633',
                  contractSignDay: '4',
                  zdFsAdoptYear: '140',
                  itemPriceDay: '68.51',
                  putonSkuNumTotal: '46633',
                  zdFsAdoptNow: '1002',
                  contractSkuNumYear: '9958',
                  tips: '',
                  wzgsContractSignNow: '818',
                  submitNumDay: '2',
                  itemNumDay: '21421',
                  contractSkuNumDay: '725',
                  submitNumMonth: '40',
                  wzgsContractSignTotal: '899',
                  itemPriceTotal: '15299.01',
                  contractSkuNumNow: '0',
                  skuNumMonth: '6451',
                  itemNumMonth: '200654',
                  itemPriceYear: '3200.70',
                  zdFsAdoptDay: '5',
                  zdCsAdoptMonth: '33',
                  submitNumTotal: '1271',
                  contractSignMonth: '34',
                  zdCsAdoptNow: '1007',
                  putonSkuNumNow: '0',
                  itemNumYear: '1529682',
                  skuNumNow: '59710',
                  putonSkuNumDay: '252',
                  itemPriceMonth: '861.29',
                  contractSkuNumTotal: '95069',
                  submitNumYear: '141',
                  skuNumTotal: '66763',
                  wzgsContractSignDay: '5',
                  contractSignNow: '900',
                  itemPriceNow: '0.00',
                  zdCsAdoptTotal: '107',
                  itemNumTotal: '491445',
                  submitNumNow: '171',
                  zdFsAdoptTotal: '12',
                  contractSignTotal: '90',
                  abbreviationName: '部门13',
                  itemNumNow: '0',
                  skuNumDay: '324',
                  putonSkuNumMonth: '460',
                  contractSkuNumMonth: '9589',
                  zdCsAdoptYear: '141',
                  zdFsAdoptMonth: '38',
                  wzgsContractSignYear: '137',
                  time: '2022-03-14',
                  zdCsAdoptDay: '8',
                  wzgsContractSignMonth: '36',
                  skuNumYear: '19545',
                },
                {
                  contractSignYear: '199',
                  putonSkuNumYear: '78793',
                  contractSignDay: '9',
                  zdFsAdoptYear: '200',
                  itemPriceDay: '146.58',
                  putonSkuNumTotal: '78793',
                  zdFsAdoptNow: '1384',
                  contractSkuNumYear: '18455',
                  wzgsContractSignNow: '1189',
                  tips: '',
                  submitNumDay: '4',
                  itemNumDay: '936931',
                  contractSkuNumDay: '4768',
                  submitNumMonth: '55',
                  wzgsContractSignTotal: '1270',
                  itemPriceTotal: '54584.16',
                  contractSkuNumNow: '0',
                  skuNumMonth: '8086',
                  itemNumMonth: '2255299',
                  itemPriceYear: '14190.53',
                  zdFsAdoptDay: '5',
                  zdCsAdoptMonth: '44',
                  submitNumTotal: '1607',
                  zdCsAdoptNow: '1392',
                  putonSkuNumNow: '0',
                  contractSignMonth: '47',
                  itemNumYear: '9997309',
                  skuNumNow: '95951',
                  putonSkuNumDay: '1419',
                  itemPriceMonth: '2220.62',
                  contractSkuNumTotal: '184437',
                  submitNumYear: '221',
                  skuNumTotal: '107138',
                  wzgsContractSignDay: '9',
                  contractSignNow: '1305',
                  itemPriceNow: '0.00',
                  zdCsAdoptTotal: '1392',
                  itemNumTotal: '29546224',
                  submitNumNow: '1607',
                  zdFsAdoptTotal: '1384',
                  contractSignTotal: '1305',
                  abbreviationName: '部门14',
                  itemNumNow: '0',
                  skuNumDay: '1181',
                  putonSkuNumMonth: '2818',
                  contractSkuNumMonth: '23564',
                  zdCsAdoptYear: '194',
                  zdFsAdoptMonth: '44',
                  wzgsContractSignYear: '187',
                  time: '2022-03-14',
                  zdCsAdoptDay: '6',
                  wzgsContractSignMonth: '45',
                  skuNumYear: '38330',
                },
                {
                  contractSignYear: '97',
                  putonSkuNumYear: '69821',
                  contractSignDay: '4',
                  zdFsAdoptYear: '89',
                  itemPriceDay: '78.80',
                  putonSkuNumTotal: '69821',
                  zdFsAdoptNow: '1159',
                  contractSkuNumYear: '6579',
                  tips: '',
                  wzgsContractSignNow: '1000',
                  submitNumDay: '0',
                  itemNumDay: '65301',
                  contractSkuNumDay: '1269',
                  submitNumMonth: '31',
                  wzgsContractSignTotal: '1142',
                  itemPriceTotal: '24703.72',
                  contractSkuNumNow: '0',
                  skuNumMonth: '11094',
                  itemNumMonth: '665400',
                  itemPriceYear: '4455.59',
                  zdFsAdoptDay: '1',
                  zdCsAdoptMonth: '40',
                  submitNumTotal: '1296',
                  contractSignMonth: '29',
                  zdCsAdoptNow: '1173',
                  putonSkuNumNow: '0',
                  itemNumYear: '2501494',
                  skuNumNow: '80063',
                  putonSkuNumDay: '2229',
                  itemPriceMonth: '806.85',
                  contractSkuNumTotal: '146885',
                  submitNumYear: '107',
                  skuNumTotal: '93125',
                  wzgsContractSignDay: '3',
                  contractSignNow: '1146',
                  itemPriceNow: '0.00',
                  zdCsAdoptTotal: '1173',
                  itemNumTotal: '7828953',
                  submitNumNow: '1296',
                  zdFsAdoptTotal: '1159',
                  contractSignTotal: '1146',
                  abbreviationName: '部门15',
                  itemNumNow: '0',
                  skuNumDay: '2360',
                  putonSkuNumMonth: '1750',
                  contractSkuNumMonth: '12974',
                  zdCsAdoptYear: '99',
                  zdFsAdoptMonth: '32',
                  wzgsContractSignYear: '99',
                  time: '2022-03-14',
                  zdCsAdoptDay: '4',
                  wzgsContractSignMonth: '27',
                  skuNumYear: '33664',
                },
                {
                  contractSignYear: '72',
                  putonSkuNumYear: '12610',
                  contractSignDay: '1',
                  zdFsAdoptYear: '69',
                  itemPriceDay: '15.50',
                  putonSkuNumTotal: '12610',
                  zdFsAdoptNow: '549',
                  contractSkuNumYear: '2757',
                  tips: '',
                  wzgsContractSignNow: '489',
                  submitNumDay: '3',
                  itemNumDay: '6753',
                  contractSkuNumDay: '16',
                  submitNumMonth: '24',
                  wzgsContractSignTotal: '522',
                  itemPriceTotal: '7554.91',
                  contractSkuNumNow: '0',
                  skuNumMonth: '1461',
                  itemNumMonth: '110763',
                  itemPriceYear: '1912.18',
                  zdFsAdoptDay: '6',
                  zdCsAdoptMonth: '21',
                  submitNumTotal: '692',
                  contractSignMonth: '12',
                  zdCsAdoptNow: '554',
                  putonSkuNumNow: '0',
                  itemNumYear: '426193',
                  skuNumNow: '17386',
                  putonSkuNumDay: '451',
                  itemPriceMonth: '318.77',
                  contractSkuNumTotal: '47787',
                  submitNumYear: '74',
                  skuNumTotal: '20228',
                  wzgsContractSignDay: '0',
                  contractSignNow: '524',
                  itemPriceNow: '0.00',
                  zdCsAdoptTotal: '554',
                  itemNumTotal: '2373726',
                  submitNumNow: '692',
                  zdFsAdoptTotal: '549',
                  contractSignTotal: '524',
                  abbreviationName: '部门16',
                  itemNumNow: '0',
                  skuNumDay: '288',
                  putonSkuNumMonth: '533',
                  contractSkuNumMonth: '252',
                  zdCsAdoptYear: '70',
                  zdFsAdoptMonth: '22',
                  wzgsContractSignYear: '70',
                  time: '2022-03-14',
                  zdCsAdoptDay: '5',
                  wzgsContractSignMonth: '13',
                  skuNumYear: '5813',
                },
                {
                  contractSignYear: '50',
                  putonSkuNumYear: '20221',
                  contractSignDay: '1',
                  zdFsAdoptYear: '45',
                  itemPriceDay: '29.28',
                  putonSkuNumTotal: '20221',
                  zdFsAdoptNow: '496',
                  contractSkuNumYear: '2616',
                  tips: '',
                  wzgsContractSignNow: '421',
                  submitNumDay: '1',
                  itemNumDay: '2518',
                  contractSkuNumDay: '226',
                  submitNumMonth: '14',
                  wzgsContractSignTotal: '459',
                  itemPriceTotal: '11413.38',
                  contractSkuNumNow: '0',
                  skuNumMonth: '1954',
                  itemNumMonth: '166931',
                  itemPriceYear: '3691.27',
                  zdFsAdoptDay: '2',
                  zdCsAdoptMonth: '10',
                  submitNumTotal: '610',
                  contractSignMonth: '7',
                  zdCsAdoptNow: '501',
                  putonSkuNumNow: '0',
                  itemNumYear: '955584',
                  skuNumNow: '23950',
                  putonSkuNumDay: '89',
                  contractSkuNumTotal: '37911',
                  itemPriceMonth: '371.93',
                  submitNumYear: '47',
                  skuNumTotal: '26457',
                  wzgsContractSignDay: '0',
                  contractSignNow: '460',
                  itemPriceNow: '0.00',
                  zdCsAdoptTotal: '501',
                  itemNumTotal: '2590470',
                  submitNumNow: '610',
                  zdFsAdoptTotal: '496',
                  contractSignTotal: '460',
                  abbreviationName: '部门17',
                  itemNumNow: '0',
                  skuNumDay: '325',
                  putonSkuNumMonth: '713',
                  contractSkuNumMonth: '2605',
                  zdCsAdoptYear: '42',
                  zdFsAdoptMonth: '10',
                  wzgsContractSignYear: '56',
                  time: '2022-03-14',
                  zdCsAdoptDay: '0',
                  wzgsContractSignMonth: '9',
                  skuNumYear: '6744',
                },
                {
                  contractSignYear: '27',
                  putonSkuNumYear: '8749',
                  contractSignDay: '0',
                  zdFsAdoptYear: '26',
                  itemPriceDay: '42.56',
                  putonSkuNumTotal: '8749',
                  zdFsAdoptNow: '224',
                  contractSkuNumYear: '3076',
                  tips: '',
                  wzgsContractSignNow: '158',
                  submitNumDay: '1',
                  itemNumDay: '26019',
                  contractSkuNumDay: '54',
                  submitNumMonth: '1',
                  wzgsContractSignTotal: '171',
                  itemPriceTotal: '5272.24',
                  contractSkuNumNow: '0',
                  skuNumMonth: '564',
                  itemNumMonth: '-572659',
                  itemPriceYear: '882.68',
                  zdFsAdoptDay: '2',
                  zdCsAdoptMonth: '3',
                  submitNumTotal: '245',
                  contractSignMonth: '3',
                  zdCsAdoptNow: '224',
                  putonSkuNumNow: '0',
                  itemNumYear: '209085',
                  skuNumNow: '10211',
                  putonSkuNumDay: '24',
                  contractSkuNumTotal: '21123',
                  itemPriceMonth: '-1573.34',
                  submitNumYear: '27',
                  skuNumTotal: '12234',
                  wzgsContractSignDay: '0',
                  contractSignNow: '172',
                  itemPriceNow: '0.00',
                  zdCsAdoptTotal: '224',
                  itemNumTotal: '670656',
                  submitNumNow: '245',
                  zdFsAdoptTotal: '224',
                  contractSignTotal: '172',
                  abbreviationName: '青藏公司',
                  itemNumNow: '0',
                  skuNumDay: '12',
                  putonSkuNumMonth: '360',
                  contractSkuNumMonth: '628',
                  zdCsAdoptYear: '25',
                  zdFsAdoptMonth: '3',
                  wzgsContractSignYear: '27',
                  time: '2022-03-14',
                  zdCsAdoptDay: '2',
                  wzgsContractSignMonth: '3',
                  skuNumYear: '2440',
                },
              ],
            },
            footerData: [
              [
                '合计',
                '',
                total.submitNumDay,
                total.submitNumMonth,
                total.submitNumYear,
                total.submitNumTotal,
                total.zdCsAdoptDay,
                total.zdCsAdoptMonth,
                total.zdCsAdoptYear,
                total.zdCsAdoptTotal,
                total.zdFsAdoptDay,
                total.zdFsAdoptMonth,
                total.zdFsAdoptYear,
                total.zdFsAdoptTotal,
                total.contractSignDay,
                total.contractSignMonth,
                total.contractSignYear,
                total.contractSignTotal,
                total.wzgsContractSignDay,
                total.wzgsContractSignMonth,
                total.wzgsContractSignYear,
                total.wzgsContractSignTotal,
                total.wzgsContractSignNow,
                total.contractSkuNumDay,
                total.contractSkuNumMonth,
                total.contractSkuNumYear,
                total.contractSkuNumTotal,
                total.skuNumMonth,
                total.skuNumTotal,
                total.skuNumNow,
                total.itemNumDay,
                total.itemNumMonth,
                total.itemNumYear,
                total.itemNumTotal,
                total.itemPriceDay,
                total.itemPriceMonth,
                total.itemPriceYear,
                total.itemPriceTotal,
              ],
            ],
            tableToolbar: {
              tools: [{ code: 'myPrint', name: '打印' }],
              custom: true,
            },
            tablePrint: {
              // 自定义打印的样式示例
              style: `
                .vxe-table
                  color: #000000; // 修改表格默认颜色
                  font-size: 12px; // 修改表格默认字体
                  font-family: "Microsoft YaHei",微软雅黑,"MicrosoftJhengHei",华文细黑,STHeiti,MingLiu; // 修改表格默认字体
                }
                .vxe-table,
                .vxe-table thead th,
                .vxe-table tbody td,
                .vxe-table tfoot td  {
                  border-color: #000000; // 修改表格边框颜色
                }
                .vxe-table thead th {
                  color: green; // 修改表头字体颜色
                  font-size: 14px; // 修改表头默认字体大小
                }
                .vxe-table tfoot td {
                  color: red; // 修改表尾字体颜色
                }
                `,
            },
          };
        },
        template: this.getTemplate(),
        methods: {
          headerCellStyle({ column, columnIndex }) {
            if (column.level === 1) {
              return this.sty.darkBlue;
            } else {
              return this.sty.blue;
            }
          },
          cellStyle({ row, rowIndex, column }) {
            return this.cellSty;
          },
          footerCellStyle() {
            return this.cellSty;
          },
          footerMethod() {
            // 接收二维数组
            return this.footerData;
          },
          toolbarToolClickEvent({ code }) {
            const $grid = this.$refs.xGrid;
            switch (code) {
              case 'myPrint':
                $grid.print();
                break;
            }
          },
        },
      });
    },

    onUpdated(options, context) {
      if (!this.isMatchRequirement(options.config)) {
        return;
      }

      const name = this.getInfo(options?.config?.styles);
      this.chart.$set(this.chart.person, 'name', name);
    },

    onUnMount() {
      // this.chart && this.chart.dispose();
    },

    onResize(opt, context) {
      // const parent = context.document.getElementById(this.containerId);
      // const { width, height } = parent.getBoundingClientRect();
      // this.debounceRender(width, height);
    },
    getInfo(styleConfigs) {
      const name = dHelper.getValue(styleConfigs, ['label', 'name']);
      return name;
    },
    getTemplate() {
      return `
        <vxe-grid
          :print-config="tablePrint"
          :toolbar-config="tableToolbar"
          @toolbar-tool-click="toolbarToolClickEvent"
          v-bind="gridOptions"
        ></vxe-grid>
      `;
    },
  };
}
